import * as utility from 'utility';//md5加密

export const getRedirectTo = ({type,avater}) => {
    // 判断用户的类型，跳转到不同的页面
    // 判断用户是否有头像，没有头像跳转到添加头像的页面
    console.log(avater);
    let url = (type === 'boss')?'/boss':'/genius';
    if(!avater) {
        url += 'info'
    }else if(avater) {
        url = '/dashboard'+url;
    }
    return url;
}

// MD5加盐加密函数
export const saltMd5 = (pass) => {
    let salt = 'werwerwer./<?><_)(*8723-0';
    return utility.md5(utility.md5(salt+pass));
}